home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / gtk-2.0 / gtk / gtkiconview.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  9.4 KB  |  202 lines

  1. /* gtkiconview.h
  2.  * Copyright (C) 2002, 2004  Anders Carlsson <andersca@gnome.org>
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Library General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Library General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Library General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  */
  19. #ifndef __GTK_ICON_VIEW_H__
  20. #define __GTK_ICON_VIEW_H__
  21.  
  22. #include <gtk/gtkcontainer.h>
  23. #include <gtk/gtktreemodel.h>
  24. #include <gtk/gtkcellrenderer.h>
  25. #include <gtk/gtkselection.h>
  26.  
  27. G_BEGIN_DECLS
  28.  
  29. #define GTK_TYPE_ICON_VIEW        (gtk_icon_view_get_type ())
  30. #define GTK_ICON_VIEW(obj)        (GTK_CHECK_CAST ((obj), GTK_TYPE_ICON_VIEW, GtkIconView))
  31. #define GTK_ICON_VIEW_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
  32. #define GTK_IS_ICON_VIEW(obj)        (GTK_CHECK_TYPE ((obj), GTK_TYPE_ICON_VIEW))
  33. #define GTK_IS_ICON_VIEW_CLASS(klass)    (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_VIEW))
  34. #define GTK_ICON_VIEW_GET_CLASS(obj)    (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
  35.  
  36. typedef struct _GtkIconView           GtkIconView;
  37. typedef struct _GtkIconViewClass      GtkIconViewClass;
  38. typedef struct _GtkIconViewPrivate    GtkIconViewPrivate;
  39.  
  40. typedef void (* GtkIconViewForeachFunc)     (GtkIconView      *icon_view,
  41.                          GtkTreePath      *path,
  42.                          gpointer          data);
  43.  
  44. typedef enum
  45. {
  46.   GTK_ICON_VIEW_NO_DROP,
  47.   GTK_ICON_VIEW_DROP_INTO,
  48.   GTK_ICON_VIEW_DROP_LEFT,
  49.   GTK_ICON_VIEW_DROP_RIGHT,
  50.   GTK_ICON_VIEW_DROP_ABOVE,
  51.   GTK_ICON_VIEW_DROP_BELOW
  52. } GtkIconViewDropPosition;
  53.  
  54. struct _GtkIconView
  55. {
  56.   GtkContainer parent;
  57.  
  58.   GtkIconViewPrivate *priv;
  59. };
  60.  
  61. struct _GtkIconViewClass
  62. {
  63.   GtkContainerClass parent_class;
  64.  
  65.   void    (* set_scroll_adjustments) (GtkIconView      *icon_view,
  66.                       GtkAdjustment    *hadjustment,
  67.                       GtkAdjustment    *vadjustment);
  68.   
  69.   void    (* item_activated)         (GtkIconView      *icon_view,
  70.                       GtkTreePath      *path);
  71.   void    (* selection_changed)      (GtkIconView      *icon_view);
  72.  
  73.   /* Key binding signals */
  74.   void    (* select_all)             (GtkIconView      *icon_view);
  75.   void    (* unselect_all)           (GtkIconView      *icon_view);
  76.   void    (* select_cursor_item)     (GtkIconView      *icon_view);
  77.   void    (* toggle_cursor_item)     (GtkIconView      *icon_view);
  78.   gboolean (* move_cursor)           (GtkIconView      *icon_view,
  79.                       GtkMovementStep   step,
  80.                       gint              count);
  81.   gboolean (* activate_cursor_item)  (GtkIconView      *icon_view);
  82. };
  83.  
  84. GType          gtk_icon_view_get_type          (void) G_GNUC_CONST;
  85. GtkWidget *    gtk_icon_view_new               (void);
  86. GtkWidget *    gtk_icon_view_new_with_model    (GtkTreeModel   *model);
  87.  
  88. void           gtk_icon_view_set_model         (GtkIconView    *icon_view,
  89.                              GtkTreeModel   *model);
  90. GtkTreeModel * gtk_icon_view_get_model         (GtkIconView    *icon_view);
  91. void           gtk_icon_view_set_text_column   (GtkIconView    *icon_view,
  92.                               gint            column);
  93. gint           gtk_icon_view_get_text_column   (GtkIconView    *icon_view);
  94. void           gtk_icon_view_set_markup_column (GtkIconView    *icon_view,
  95.                             gint            column);
  96. gint           gtk_icon_view_get_markup_column (GtkIconView    *icon_view);
  97. void           gtk_icon_view_set_pixbuf_column (GtkIconView    *icon_view,
  98.                             gint            column);
  99. gint           gtk_icon_view_get_pixbuf_column (GtkIconView    *icon_view);
  100.  
  101. void           gtk_icon_view_set_orientation   (GtkIconView    *icon_view,
  102.                                    GtkOrientation  orientation);
  103. GtkOrientation gtk_icon_view_get_orientation   (GtkIconView    *icon_view);
  104. void           gtk_icon_view_set_columns       (GtkIconView    *icon_view,
  105.                              gint            columns);
  106. gint           gtk_icon_view_get_columns       (GtkIconView    *icon_view);
  107. void           gtk_icon_view_set_item_width    (GtkIconView    *icon_view,
  108.                             gint            item_width);
  109. gint           gtk_icon_view_get_item_width    (GtkIconView    *icon_view);
  110. void           gtk_icon_view_set_spacing       (GtkIconView    *icon_view, 
  111.                              gint            spacing);
  112. gint           gtk_icon_view_get_spacing       (GtkIconView    *icon_view);
  113. void           gtk_icon_view_set_row_spacing   (GtkIconView    *icon_view, 
  114.                             gint            row_spacing);
  115. gint           gtk_icon_view_get_row_spacing   (GtkIconView    *icon_view);
  116. void           gtk_icon_view_set_column_spacing (GtkIconView    *icon_view, 
  117.                             gint            column_spacing);
  118. gint           gtk_icon_view_get_column_spacing (GtkIconView    *icon_view);
  119. void           gtk_icon_view_set_margin        (GtkIconView    *icon_view, 
  120.                             gint            margin);
  121. gint           gtk_icon_view_get_margin        (GtkIconView    *icon_view);
  122.  
  123.  
  124. GtkTreePath *  gtk_icon_view_get_path_at_pos   (GtkIconView     *icon_view,
  125.                         gint             x,
  126.                         gint             y);
  127. gboolean       gtk_icon_view_get_item_at_pos   (GtkIconView     *icon_view,
  128.                         gint              x,
  129.                         gint              y,
  130.                         GtkTreePath     **path,
  131.                         GtkCellRenderer **cell);
  132. gboolean       gtk_icon_view_get_visible_range (GtkIconView      *icon_view,
  133.                         GtkTreePath     **start_path,
  134.                         GtkTreePath     **end_path);
  135.  
  136. void           gtk_icon_view_selected_foreach   (GtkIconView            *icon_view,
  137.                          GtkIconViewForeachFunc  func,
  138.                          gpointer                data);
  139. void           gtk_icon_view_set_selection_mode (GtkIconView            *icon_view,
  140.                          GtkSelectionMode        mode);
  141. GtkSelectionMode gtk_icon_view_get_selection_mode (GtkIconView            *icon_view);
  142. void             gtk_icon_view_select_path        (GtkIconView            *icon_view,
  143.                            GtkTreePath            *path);
  144. void             gtk_icon_view_unselect_path      (GtkIconView            *icon_view,
  145.                            GtkTreePath            *path);
  146. gboolean         gtk_icon_view_path_is_selected   (GtkIconView            *icon_view,
  147.                            GtkTreePath            *path);
  148. GList           *gtk_icon_view_get_selected_items (GtkIconView            *icon_view);
  149. void             gtk_icon_view_select_all         (GtkIconView            *icon_view);
  150. void             gtk_icon_view_unselect_all       (GtkIconView            *icon_view);
  151. void             gtk_icon_view_item_activated     (GtkIconView            *icon_view,
  152.                            GtkTreePath            *path);
  153. void             gtk_icon_view_set_cursor         (GtkIconView            *icon_view,
  154.                            GtkTreePath            *path,
  155.                            GtkCellRenderer        *cell,
  156.                            gboolean                start_editing);
  157. gboolean         gtk_icon_view_get_cursor         (GtkIconView            *icon_view,
  158.                            GtkTreePath           **path,
  159.                            GtkCellRenderer       **cell);
  160. void             gtk_icon_view_scroll_to_path     (GtkIconView            *icon_view,
  161.                                                    GtkTreePath            *path,
  162.                            gboolean                use_align,
  163.                            gfloat                  row_align,
  164.                                                    gfloat                  col_align);
  165.  
  166. /* Drag-and-Drop support */
  167. void                   gtk_icon_view_enable_model_drag_source (GtkIconView              *icon_view,
  168.                                    GdkModifierType           start_button_mask,
  169.                                    const GtkTargetEntry     *targets,
  170.                                    gint                      n_targets,
  171.                                    GdkDragAction             actions);
  172. void                   gtk_icon_view_enable_model_drag_dest   (GtkIconView              *icon_view,
  173.                                    const GtkTargetEntry     *targets,
  174.                                    gint                      n_targets,
  175.                                    GdkDragAction             actions);
  176. void                   gtk_icon_view_unset_model_drag_source  (GtkIconView              *icon_view);
  177. void                   gtk_icon_view_unset_model_drag_dest    (GtkIconView              *icon_view);
  178. void                   gtk_icon_view_set_reorderable          (GtkIconView              *icon_view,
  179.                                    gboolean                  reorderable);
  180. gboolean               gtk_icon_view_get_reorderable          (GtkIconView              *icon_view);
  181.  
  182.  
  183. /* These are useful to implement your own custom stuff. */
  184. void                   gtk_icon_view_set_drag_dest_item       (GtkIconView              *icon_view,
  185.                                    GtkTreePath              *path,
  186.                                    GtkIconViewDropPosition   pos);
  187. void                   gtk_icon_view_get_drag_dest_item       (GtkIconView              *icon_view,
  188.                                    GtkTreePath             **path,
  189.                                    GtkIconViewDropPosition  *pos);
  190. gboolean               gtk_icon_view_get_dest_item_at_pos     (GtkIconView              *icon_view,
  191.                                    gint                      drag_x,
  192.                                    gint                      drag_y,
  193.                                    GtkTreePath             **path,
  194.                                    GtkIconViewDropPosition  *pos);
  195. GdkPixmap             *gtk_icon_view_create_drag_icon         (GtkIconView              *icon_view,
  196.                                    GtkTreePath              *path);
  197.  
  198.  
  199. G_END_DECLS
  200.  
  201. #endif /* __GTK_ICON_VIEW_H__ */
  202.